package com.virtual.repository.common.model;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Class representing the <strong>collection</strong> element from configuration file, which
 * is placed inside <strong>property</strong> element.  
 * 
 * @author kchaber
 */
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "collection")
public class CollectionProperty implements Serializable {
	private static final long serialVersionUID = -225576395731213088L;

	/**
	 * The name of the collection in Java Object
	 */
	@XmlAttribute(name = "name")
	private String name;
	
	/**
	 * The fully qualified class name of the collection type
	 */
	@XmlAttribute(name = "class")
	private String className;
	
	/**
	 * The fully qualified class name of the single element of the collection 
	 */
	@XmlAttribute(name = "property-class")
	private String propertyClass;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getPropertyClass() {
		return propertyClass;
	}

	public void setPropertyClass(String propertyClass) {
		this.propertyClass = propertyClass;
	}

	@Override
	public String toString() {
		return getClass().getName() + " [name=" + name + ", className=" + className + ", propertyClass=" + propertyClass + "]";
	}

}
